#include <iostream>
#include <ctime>
#include "Book.h"
#include "Date.h"

using namespace std;

// About <ctime>, see https://www.runoob.com/cprogramming/c-standard-library-time-h.html

int main()
{
	time_t tmNow = time(NULL);
	tm *pt=gmtime(&tmNow);
	Date d(1900 + pt->tm_year, 1 + pt->tm_mon, pt->tm_mday);

	Book b1("Java", "ABC", Date(2010, 3, 1)),
	     b2("C++", "Andrew", Date(2017, 3, 18)),
	     b3("Python", "Harry", d);

	Book *bk[] = {&b1, &b2, &b3};
	for (int i = 0; i < 3; i++)
	{
		bk[i]->show();
	}
	cout << "==============================\n";
	cout << "Total: " << Book::getTotal() << endl;

	return 0;
}
